import axios from '~/axios'

//添加订单
export function addApi(data) {
    return axios.post('/tc/order/add', data)
}

//删除订单
export function deleteApi(orderId) {
    return axios({
        method: 'DELETE',
        url: '/tc/order/delete',
        params: {
            orderId: orderId
        }
    })
}

//修改订单
export function updateApi(data) {
    return axios.put('/tc/order/update', data)
}

//获取订单列表 - 分页
export function getPageListApi(params) {
    return axios({
        method: 'GET',
        url: '/tc/order/getPageList',
        params: params
    })
}

//获取订单详细信息
export function getApi(orderId) {
    return axios.get(`/tc/order/get/${orderId}`)
}

// 添加以下方法到 order.js 文件中

/**
 * 下载订单导入模板
 */
export function downloadTemplateApi() {
    return request({
        url: '/tc/order/downloadTemplate',
        method: 'get',
        responseType: 'blob'
    });
}
